package com.springboot.distributed.transaction.zookeeper;

import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 事务消息
 *
 * @author supu
 * @date 2019-09-11 15:29
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TransactionMessage implements Serializable {
    private static final long serialVersionUID = 9062527828304941087L;

    /**
     * 唯一key
     */
    private String uniqueKey;

    /**
     * 事务状态枚举
     */
    private TransactionStatusEnum transactionStatusEnum;

    public boolean isCommit() {
        return TransactionStatusEnum.COMMIT.equals(transactionStatusEnum);
    }
}
